package com.winit.indexing.service;

import com.winit.indexing.manager.IndexingManager;
import com.winit.indexing.model.Indexing;
import com.winit.indexing.model.IndexingId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class IndexingServiceImpl implements  IIdexingService{

    private static Logger log = LoggerFactory.getLogger(IndexingServiceImpl.class);

    @Autowired
    private IndexingManager indexingManager;

    @Override
    public void indexing(Indexing indexing) throws Exception{
        this.indexingManager.indexing(indexing);
    }

    @Override
    public void remove(IndexingId indexingId, String[] referredIds) throws Exception{
        this.indexingManager.remove(indexingId, referredIds);
    }

    @Override
    public void removeIfExists(IndexingId indexingId, String[] referredIds){
        this.indexingManager.removeIfExists(indexingId, referredIds);
    }

    @Override
    public Indexing getIndexing(IndexingId indexingId) {
        return this.indexingManager.getIndexing(indexingId);
    }

    @Override
    public List<String> getFilterTag(String indexGroup) {
        return this.indexingManager.getFilterTag(indexGroup);
    }

    @Override
    public List<Indexing> getFilterTagMap(String indexGroup) {
        return this.indexingManager.getFilterTagMap(indexGroup);
    }

    @Override
    public Indexing reflushIndex(Indexing indexing) {
        return this.indexingManager.reflushIndexing(indexing);
    }

    @Override
    public boolean deleteIndex(IndexingId indexingId) {
        return this.indexingManager.deleteIndex(indexingId);
    }
}
